package com.big.app.controller;


import com.big.app.entity.Shopping;
import com.big.app.service.intf.ShoppingService;
import com.big.app.vo1.R;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@CrossOrigin// 跨域
@Api(value = "用户注册操作",tags = "用户注册操作")
public class ShoppingController {

    @Autowired
    private ShoppingService service;

    @PostMapping("/api/shopping/all.do")
    @ResponseBody
    public R a(@RequestBody Shopping shopping){
        R all = service.all(shopping);
        System.out.println(all);
        return all;
    }

    @PostMapping("/api/shopping/detail.do")
    @ResponseBody
    public R b(@RequestBody Shopping shopping){
        R all = service.update(shopping);
        System.out.println(all);
        return all;
    }
}
